<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class Update3 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('box_skus', function (Blueprint $table) {
            $table->tinyInteger('chip_status')->default(0)->index()->after('status')->comment('是否开启兑换碎片 1为开启，0为不开启');
            $table->integer('chip_id')->nullable()->index()->after('status')->comment('可以兑换的碎片的id');
            $table->tinyInteger('chip_need_sku_total')->nullable()->after('status')->comment('需要集齐的sku数');
            $table->tinyInteger('chip_total')->nullable()->after('status')->comment('可以兑换的碎片数');
            $table->integer('chip_cover_count')->default(0)->after('status')->comment('兑换的次数统计');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('box_skus', function (Blueprint $table) {
            $table->dropColumn('chip_status');
            $table->dropColumn('chip_id');
            $table->dropColumn('chip_need_sku_total');
            $table->dropColumn('chip_total');
            $table->dropColumn('chip_cover_count');
        });
    }
}
